// JavaScript Document
profileform = jQuery.noConflict();
profileform().ready(function() {
							// alert{'test'};
					
profileform("#profile-form-node-form").validate({
												
													  
  rules: {
	  'field_profile_position[und]':{
	  	required: true,
		
		valuenotequals: '_none',
	  },
	  'title':{
		required:true,
		minlength: 5,
		maxlength: 255,
		badchar:true,
	  },
	  
	  'field_profile_designation[und][0][value]':{
		 badchar:true,
		 minlength: 5,
		 maxlength: 255,
	  },
	  'field_profile_education[und][0][value]':{
		  badchar:true,
	  },
	   'field_profile_birth[und][0][value]':{
		  badchar:true,
	  },
	  'field_profile_father[und][0][value]':{
		  badchar:true,
	  },
	   'field_profile_mother[und][0][value]':{
		  badchar:true,
	  },
	   'field_profile_child[und][0][value]':{
		  badchar:true,
	  },
	  'field_profile_profession[und][0][value]':{
		  badchar:true,
	  },
	  'field_profile_career[und][0][value]':{
		  badchar:true,
	  },
	  'field_profile_activities[und][0][value]':{
		  badchar:true,
	  },
	  'field_profile_publication[und][0][value]':{
		  badchar:true,
	  },
	  'field_profile_award[und][0][value]':{
		  badchar:true,
	  },
	   'field_profile_foreign[und][0][value]':{
		  badchar:true,
	  },
	     'field_profile_hobbies[und][0][value]':{
		  badchar:true,
	  },
	    'field_profile_addinfo[und][0][value]':{
		  badchar:true,
	  },
	    'field_profile_contact[und][0][value]':{
		  badchar:true,
	  },
	
	
	'field_profile_email[und][0][value]':{
	email:true,
	},
	'field_profile_url[und][0][value]':{
	url:true,
	},
	'field_pro_phone1_code[und][0][value]':{
		digits:true,
		minlength:3,
		maxlength:5,
	},
	'field_pro_phone2_code[und][0][value]':{
		digits:true,
		minlength:3,
		maxlength:5,
	},
	'field_pro_fax_code[und][0][value]':{
		digits:true,
		minlength:3,
		maxlength:5,
	},
	'field_profile_phone[und][0][value]':{
		digits:true,
		minlength:6,
		maxlength:8,
	},
	'field_pro_phone2[und][0][value]':{
		digits:true,
		minlength:6,
		maxlength:8,
	},
	'field_profile_fax[und][0][value]':{
		digits:true,
		minlength:6,
		maxlength:8,
	},
	'field_profile_assumed[und][0][value][date]':{
	date_notgreater_tdy:true,
		},
		
'field_profile_dob[und][0][value][date]':{
	date_notgreater_tdy:true,
		},
	
  },
	// JavaScript Document

													  
  messages: {
	  
	  'field_profile_position[und]':{
							required: 'Please Select Position',
							
							valuenotequals: 'Please Select Position',
							},
	  
	  'title':{
		required:'Please Enter the Name',
		minlength:'Minimum 5 characters should be entered',
		maxlength: 'Maximum 255 character only allowed',
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	  },
	 'field_profile_designation[0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
		 minlength: 'Minimum 5 characters should be entered',
		 maxlength: 'Maximum 255 character only allowed',
	  },
	  'field_profile_education[und][0][value]':{
		  badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	  },
	  'field_profile_birth[und][0][value]':{
		  badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	  },
	  
	   'field_profile_father[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_father[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_mother[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	
	'field_profile_child[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	
	'field_profile_child[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_profession[und][0]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_career[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_activities[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_publication[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	
	'field_profile_award[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_foreign[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_hobbies[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_addinfo[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_contact[und][0][value]':{
		badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	},
	'field_profile_phone[und][0][value]':{  
		digits:'Numbers only should be entered',
		minlength:'Minimum 6 characters should be entered',
		maxlength:'Maximum 8 character only allowed',
	},
	'field_pro_phone2_code[und][0][value]':{  
		digits:'Numbers only should be entered',
		minlength:'Minimum 6 characters should be entered',
		maxlength:'Maximum 8 character only allowed',
	},
	'field_profile_assumed[und][0][value][date]':{  
		date_notgreater_tdy:'Date Should Not Be Greater Than Current Date',
		
	},
	
	'field_profile_email[und][0][value]':{
	email:'Not Valid email',
	},
	'field_profile_url[und][0][value]':{
	url:'Not Valid URL',
	},
	'field_pro_phone1_code[und][0][value]':{
		digits:'Numbers only should be entered',
		minlength:'Minimum 3 characters should be entered',
		maxlength:'Maximum 5 character only allowed',
	},
	'field_profile_assumed[und][0][value][date]':{
		date_notgreater_tdy:'Date Should Not Be Greater Than Current Date',
	},
	
	'field_profile_dob[und][0][value][date]':{
	date_notgreater_tdy:'Date Should Not Be Greater Than Current Date',
	},
	'field_pro_fax_code[und][0][value]':{
		digits:'Numbers only should be entered',
		minlength:'Minimum 3 characters should be entered',
		maxlength:'Maximum 5 character only allowed',
	},
	'field_profile_phone[und][0][value]':{
		digits:'Numbers only should be entered',
		minlength:'Minimum 6 characters should be entered',
		maxlength:'Maximum 8 character only allowed',
	},
	'field_pro_phone2[und][0][value]':{
		digits:'Numbers only should be entered',
		minlength:'Minimum 6 characters should be entered',
		maxlength:'Maximum 8 character only allowed',
	},
	'field_profile_fax[und][0][value]':{
		digits:'Numbers only should be entered',
		minlength:'Minimum 6 characters should be entered',
		maxlength:'Maximum 8 character only allowed',
	},
	
  },
    invalidHandler: function(form, validator) {
       
       					 if (!validator.numberOfInvalids())
								return;
						else{
							
							  //profileform("#documents-node-form").create_errormsg_container('errormsg_container','documents-node-form');
						}
							
							profileform('html, body').animate({
								scrollTop: profileform(validator.errorList[0].element).offset().top - 100
							}, 1000);
							
						},
   
	});
});
       
